﻿#region GNU GPL Version 3 License

/// Copyright 2013 Shailesh Lolam
/// 
/// This file Base.cs is part of AzEzAuto.
/// 
/// AzEzAuto is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
/// 
/// AzEzAuto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
/// 
/// You should have received a copy of the GNU General Public License along with AzEzAuto. If not, see http://www.gnu.org/licenses/.
/// 
/// History:
/// ______________________________________________________________
/// Created         04-2013             Shailesh Lolam

#endregion
      
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AzEzAuto.Utils;
using System.Security.Cryptography.X509Certificates;

namespace AzEzAuto.Management
{
    public class Base
    {
        protected HttpApi _httpApi;
        protected const string VERSION = "2012-03-01";
        protected const string VERSION_TAG = "x-ms-version";
        protected const string REQUEST_ID = "x-ms-request-id";
        protected string _version;
        
        public Base(HttpApi httpApi)
            : this(httpApi, VERSION)
        {
        }

        public Base(HttpApi httpApi, string version)
        {
            Guard.ArgumentNull(httpApi, "httpApi");
            Guard.ArgumentNullOrEmpty(version, "version");
            if (version.Length != 10)
                throw new ArgumentException("version");

            _version = version;
            _httpApi = httpApi;
        }

        public X509Certificate2 Certificate
        { get { return _httpApi.Certificate; } }

        public string Version
        { get { return _version; } }
    }
}
